namespace FileCollection
{
    using System;
    using System.IO;
    using System.Security.Cryptography;

    [Serializable]
    public class RecoveryInfo
    {
        #region Constructors
        public RecoveryInfo(Stream data, string parentId)
        {
            this.Size = data.Length;
            data.Seek(0, SeekOrigin.Begin);
            this.Hash = BitConverter.ToString(MD5.Create().ComputeHash(data));
            data.Seek(0, SeekOrigin.Begin);
            this.ParentID = parentId;
        }

        #endregion

        #region Properties
        public long Size
        {
            get;
            private set;
        }

        public string Hash
        {
            get;
            private set;
        }

        public string ParentID
        {
            get;
            private set;
        }

        #endregion
    }
}
